<?php
/**
 * Created by PhpStorm.
 * User: lenovo
 * Date: 2017/3/27
 * Time: 8:52
 */

namespace api\modules\test\controllers;


use common\components\big_data\bairong\CONFIG;
use common\components\big_data\bairong\Core;
use common\components\gps\Jimi;
use common\components\sms\Lhwt;
use common\components\tools\Api;
use common\components\tools\Bank;
use common\models\Custom;
use yii\httpclient\Client;

class TestController extends \wodrow\yii\rest\Controller
{
    /**
     * 测试 test test
     */
    public function actionTest()
    {
//        header('Access-Control-Allow-Origin: *');
        return [
            'x' => "xxx"
        ];
        /*$custom = Custom::findOne(65);
        return $custom->creditOrderSelf->toArray();*/
        /*$x = Bank::UploadIcbcPics0([
            ['picid'=>'0001', 'picurl'=>'http://img.zcool.cn/community/010a1b554c01d1000001bf72a68b37.jpg@1280w_1l_2o_100sh.png'],
            ['picid'=>'0002', 'picurl'=>'http://img.zcool.cn/community/010a1b554c01d1000001bf72a68b37.jpg@1280w_1l_2o_100sh.png'],
            ['picid'=>'0003', 'picurl'=>'http://img.zcool.cn/community/010a1b554c01d1000001bf72a68b37.jpg@1280w_1l_2o_100sh.png'],
            ['picid'=>'0004', 'picurl'=>'http://img.zcool.cn/community/010a1b554c01d1000001bf72a68b37.jpg@1280w_1l_2o_100sh.png'],
        ]);
        return $x;*/
    }

    /**
     * bairong list
     * @desc bairong测试列表
     */
    public function actionBairongList()
    {
        header("Content-Type: text/html; charset=UTF-8");
        define("STATUS", "1");    // 1正式 2测试
        $headerTitle = array(
            'huaxiang' => array(
//                "SpecialList_c",
//                "ApplyLoanStr",
//                "Execution",

                "RuleSpecialList",
                "RuleExecution",
                "RuleApplyLoan",
            ),
            /*'haina' => array(
//                "IdTwo_photo",
                'BadInfo',
            ),*/
            'TrinityForceAPI' => array(
//                "TrinityForceAPI",
                "BadInfo",
            ),
        );
        $targetList = array(
            /*array(
                "name" => "阿斯",
                "id" => "310224196209243110",  //
                "cell" => "15921188518",   //
                "mail" => "000000@qq.com",
                "bank_id" => "4367421216244199784"
            ),*/
            array(
                "name" => "马巧妮",
                "id" => "500110198509160828",  //
                "cell" => "15881011080",   //
                "mail" => "164235168@qq.com",
//                "bank_id" => "6013823100088941471",
            )
        );
        CONFIG::init();
        $core = Core::getInstance(CONFIG::$account, CONFIG::$password, CONFIG::$apicode, CONFIG::$querys);
        $core->pushTargetList($targetList);
        $core->mapping($headerTitle);
        exit;
        $client = new Client();
        $l_arr = [
            'userName' => 'ysjrAPI',
            'password' => 'ysjrAPI',
            'apiCode' => '3001052',
        ];
        $r = $client->post('https://api.100credit.cn/bankServer2/user/login.action', $l_arr)->send();
        $c = json_decode($r->content, true, 512);
        $o['login_data'] = $l_arr;
        $o['login_reslut'] = $c;
        $token = $c['tokenid'];
        $url = 'https://api.100credit.cn/bankServer2/data/terData.action';
        $j_arr = [
            "id" => "310224196209243110",  //
            "cell" => ["15921188518"],  //
            "name" => "阿斯",
//            "mail" => ["000000@qq.com"],
//            "bank_id" => "4367421216244199784",
//            "meal" => "SpecialList_c", // ,ApplyLoanStr,Execution
            "meal" => "RuleExecution,RuleSpecialList,RuleApplyLoan", // ,ApplyLoanStr,Execution
        ];
        $arr = [
            'tokenid' => $token,
//            'interCommand' => '1000',
            'apiCode' => '3001052',
            'jsonData' => json_encode($j_arr),
            'checkCode' => md5(json_encode($j_arr) . md5('3001052' . $token)),
        ];
        $client = new Client();
        $r = $client->post($url, $arr)->send();
        $c = json_decode($r->content, true, 512);
        $o['r'] = $c;
        return $o;
    }

	/**
	 * 模拟工行回调
	 * @desc faker bank back for credit submit
	 */
	public function actionTestFakerSubmitCreditBankBack()
	{
		$data = array(
			'_api' => 'credit',
			'_get' =>
				array(
					'_URL_' =>
						array(
							0 => 'Icbc',
							1 => 'credit',
						),
				),
			'_post' =>
				array(
					'reqparam' => '{"pub":{"platno":"ysxc","cmpseq":"20180125140232507060","zoneno":"3301","phybrno":"12020230","orderno":"!ysjr000000053755","assurerno":"514","cmpdate":"20180125","cmptime":"140232"},"req":{"custname":"林柏龙","idno":"330327195910300455","relation":"配偶","result":"001","loanCrdt":"-","cardCrdt":"-","leftNum":"-","leftAmount":"-","note":"关注"}}',
				),
			'_server' =>
				array(
					'USER' => 'www',
					'HOME' => '/home/www',
					'FCGI_ROLE' => 'RESPONDER',
					'GATEWAY_INTERFACE' => 'CGI/1.1',
					'SERVER_SOFTWARE' => 'nginx/1.8.0',
					'QUERY_STRING' => '',
					'REQUEST_METHOD' => 'POST',
					'CONTENT_TYPE' => 'application/x-www-form-urlencoded',
					'CONTENT_LENGTH' => '636',
					'SCRIPT_FILENAME' => '/home/wwwroot/credit_ysjr/index.php',
					'SCRIPT_NAME' => '/index.php',
					'REQUEST_URI' => '/Icbc/credit',
					'DOCUMENT_URI' => '/index.php/Icbc/credit',
					'DOCUMENT_ROOT' => '/home/wwwroot/credit_ysjr',
					'SERVER_PROTOCOL' => 'HTTP/1.1',
					'REMOTE_ADDR' => '12.1.1.6',
					'REMOTE_PORT' => '54161',
					'SERVER_ADDR' => '109.2.132.210',
					'SERVER_PORT' => '80',
					'SERVER_NAME' => 'ysjr.qiche100.com',
					'REDIRECT_STATUS' => '200',
					'PATH_INFO' => '/Icbc/credit',
					'HTTP_USER_AGENT' => 'cn.com.icbc.workflow.component.comm.AwcHttpComm',
					'HTTP_CONTENT_TYPE' => 'application/x-www-form-urlencoded',
					'HTTP_HOST' => '109.2.132.210',
					'HTTP_CONTENT_LENGTH' => '636',
					'PHP_SELF' => '/Icbc/credit',
					'REQUEST_TIME_FLOAT' => 1482306307.4561639,
					'REQUEST_TIME' => 1482306307,
				),
			'_input' => 'reqparam=%7B%22pub%22%3A%7B%22platno%22%3A%22ysxc%22%2C%22cmpseq%22%3A%2220170418091950445108%22%2C%22zoneno%22%3A%223307%22%2C%22phybrno%22%3A%2212020230%22%2C%22orderno%22%3A%22%E6%B5%99G03-161221-002%22%2C%22assurerno%22%3A%22514%22%2C%22cmpdate%22%3A%2220161221%22%2C%22cmptime%22%3A%22104237%22%7D%2C%22req%22%3A%7B%22custname%22%3A%22%E9%82%B5%E6%B5%B7%E5%87%A4%22%2C%22idno%22%3A%22411327199003292913%22%2C%22relation%22%3A%22%E6%9C%AC%E4%BA%BA%22%2C%22result%22%3A%22001%22%2C%22loanCrdt%22%3A%22-%22%2C%22cardCrdt%22%3A%22-%22%2C%22leftNum%22%3A%22-%22%2C%22leftAmount%22%3A%22-%22%2C%22note%22%3A%22%E5%85%B3%E6%B3%A8%22%7D%7D',
		);
		$client = new Client([
			'baseUrl' => "http://192.168.99.2:9101/Icbc/credit",
		]);
		$response = $client->post('', $data['_post'])->send();
		return json_decode($response->content);
	}
	
	/**
	 * 模拟申请分期
	 * @desc post/get
	 * @return object response
	 */
	public function actionFakerAskForDivi()
	{
//		$token = $headers = \Yii::$app->request->headers->get('token');
//		$token = \Yii::$app->user->identity->token;
		$token = '4845304c8a8c44e57dbeae4b863da953';
		$timestamp = time();
		$nonce = $timestamp.rand(1000, 9999);
//		$sign_key = \Yii::$app->user->identity->sign_key;
		$sign_key = '60f46cbd6a52c73b0176d6d72c21aec3';
		$signature = md5($token.$timestamp.$nonce.$sign_key);
//		var_dump($signature);exit;
		$data = [
			'orderno' => 'ysxc20160926000003',
			'Mobile' => '18739910648',
			'Address' => 'test',
			'Unit' => 'test',
			'carType' => '1',
			'Price' => '100000',
			'carNo1' => 'asd123',
			'carRegNo' => 'asdfghjkl',
			'shorp4s' => 'test',
			'carNo2' => '浙DX912U',
			'PaidAmt' => '20000',
			'Amount' => '120000',
			'Term' => '36',
			'Interest' => '8.5',
			'FeeMode' => '2',
			'IsPawn' => '1',
			'PawnGoods' => 'asd1231',
			'IsAssure' => '1',
			'tiexiFlag' => '0',
			'tiexiRate' => '8.5',
			'card' => 'asdfghjklzxcvbnmqwe',
			'note' => 'test',
			'pics' => serialize([
				['picid' => '001', 'picurl' => 'test1', 'note' => ''],
				['picid' => '002', 'picurl' => 'test2', 'note' => ''],
			]),
			'resubmit' => 0,
		];
		$client = new Client([
			'baseUrl' => "http://192.168.1.102:9101/bank/business/ask-for-divided-payments",
		]);
		$response = $client->post('', $data, [
			'token' => $token,
			'timestamp' => $timestamp,
			'nonce' => $nonce,
			'signature' => $signature,
		])->send();
		return json_decode($response->content);
	}

    /**
     * 模拟一手车业务
     */
	public function actionFakerAskForNewCarService()
    {
        $data = [
//            'orderno' => '赣01-170428-001',
//
//            'custName' => 'test', // 客户名称
//            'IdType' =>  '000', // 证件类型
//            'IdNo' => '411327199003292913', // 证件编号
            'Mobile' => '17091551612', // 联系电话
            'Address' => 'test', // 家庭住址
            'Unit' => 'test', // 单位名称

            'Note' => 'test', // 申请备注

            'carType' => '起亚牌YQZ7144AE5', // 车辆型号 示例:起亚牌YQZ7144AE5
            'Price' => 100000, // 车辆价格
            'carNo1' => 'LSGGF53X7AH126348', // 车架号
            'carRegNo' => '510008330741', // 登记证书编号
            'carNo2' => '甘FDJ255', // 车牌号

            'PaidAmt' => 20000, // 首付金额
            'Amount' => 80000, // 分期金额
            'Term' => 12, // 分期期数
            'Interest' => 8.5, // 分期手续费率 8.5%
            'FeeMode' => 2, // 手续费收取方式
            'IsPawn' => 1, // 是否抵押
            'PawnGoods' => 'LSGGF53X7AH126348起亚牌YQZ7144AE5', // 抵押物 车架号+车辆型号
            'IsAssure' => 1, // 是否担保
            'tiexiFlag' => 0, // 是否贴息
            'tiexiRate' => 0, // 贴息费率
            'card' => '', // 信用卡

            'pics' => [
                ['picid' => '0101', 'picurl' => 'http://127.0.0.1/404.jpg', 'note' => ''],
                ['picid' => '0102', 'picurl' => 'http://127.0.0.1/404.jpg', 'note' => ''],
                ['picid' => '0103', 'picurl' => 'http://127.0.0.1/404.jpg', 'note' => ''],
                ['picid' => '0104', 'picurl' => 'http://127.0.0.1/404.jpg', 'note' => ''],
                ['picid' => '0201', 'picurl' => 'http://127.0.0.1/404.jpg', 'note' => ''],
                ['picid' => '0202', 'picurl' => 'http://127.0.0.1/404.jpg', 'note' => ''],
                ['picid' => '0203', 'picurl' => 'http://127.0.0.1/404.jpg', 'note' => ''],
                ['picid' => '0204', 'picurl' => 'http://127.0.0.1/404.jpg', 'note' => ''],
                ['picid' => '0301', 'picurl' => 'http://127.0.0.1/404.jpg', 'note' => ''],
                ['picid' => '0302', 'picurl' => 'http://127.0.0.1/404.jpg', 'note' => ''],
                ['picid' => '0303', 'picurl' => 'http://127.0.0.1/404.jpg', 'note' => ''],
                ['picid' => '0401', 'picurl' => 'http://127.0.0.1/404.jpg', 'note' => ''],
                ['picid' => '0501', 'picurl' => 'http://127.0.0.1/404.jpg', 'note' => ''],
                ['picid' => '0502', 'picurl' => 'http://127.0.0.1/404.jpg', 'note' => ''],
                ['picid' => '0503', 'picurl' => 'http://127.0.0.1/404.jpg', 'note' => ''],
                ['picid' => '0601', 'picurl' => 'http://127.0.0.1/404.jpg', 'note' => ''],
                ['picid' => '0602', 'picurl' => 'http://127.0.0.1/404.jpg', 'note' => ''],
                ['picid' => '0701', 'picurl' => 'http://127.0.0.1/404.jpg', 'note' => ''],
                ['picid' => '0702', 'picurl' => 'http://127.0.0.1/404.jpg', 'note' => ''],
                ['picid' => '0703', 'picurl' => 'http://127.0.0.1/404.jpg', 'note' => ''],
                ['picid' => '0704', 'picurl' => 'http://127.0.0.1/404.jpg', 'note' => ''],
                ['picid' => '0801', 'picurl' => 'http://127.0.0.1/404.jpg', 'note' => ''],
                ['picid' => '0802', 'picurl' => 'http://127.0.0.1/404.jpg', 'note' => ''],
                ['picid' => '0901', 'picurl' => 'http://127.0.0.1/404.jpg', 'note' => ''],
                ['picid' => '0902', 'picurl' => 'http://127.0.0.1/404.jpg', 'note' => ''],
            ],

            'resubmit' => 0, // 继续申请标志
        ];
        $data = serialize($data);
        $data = [
            'orderno' => '赣04-170428-001',

            'custName' => '周友波', // 客户名称
            'IdType' =>  '000', // 证件类型
            'IdNo' => '362202198304092017', // 证件编号

            'serialize_data'=>$data,
        ];
        $r = Api::request('/bank/business/ask-for-new-car-service', $data);
        return json_decode($r->content);
    }

    /**
     * 模拟二手车业务
     */
    public function actionFakerAskForUsedCarService()
    {
        $data = [
//            'orderno' => '赣01-170428-001',
//
//            'custName' => 'test', // 客户名称
//            'IdType' =>  '000', // 证件类型
//            'IdNo' => '411327199003292913', // 证件编号
            'Mobile' => '17091551612', // 联系电话
            'Address' => 'test', // 家庭住址
            'Unit' => 'test', // 单位名称

            'Note' => 'test', // 申请备注

            'carType' => '起亚牌YQZ7144AE5', // 车辆型号 示例:起亚牌YQZ7144AE5
            'Price' => 100000, // 车辆价格
            'carNo1' => 'LSGGF53X7AH126348', // 车架号
            'carRegNo' => '510008330741', // 登记证书编号
            'carNo2' => '甘FDJ255', // 车牌号
            'AssessPrice' => 100000, // 车辆评估价格
            'AssessOrg' => 0, // 评估机构
            'UsedYears' => 36, // 使用年限（月）

            'PaidAmt' => 20000, // 首付金额
            'Amount' => 80000, // 分期金额
            'Term' => 12, // 分期期数
            'Interest' => 8.5, // 分期手续费率 8.5%
            'FeeMode' => 2, // 手续费收取方式
            'IsPawn' => 1, // 是否抵押
            'PawnGoods' => 'LSGGF53X7AH126348起亚牌YQZ7144AE5', // 抵押物 车架号+车辆型号
            'IsAssure' => 1, // 是否担保
            'tiexiFlag' => 0, // 是否贴息
            'tiexiRate' => 0, // 贴息费率

            'card' => '', // 信用卡

            'pics' => [
                ['picid' => '0101', 'picurl' => 'http://127.0.0.1/404.jpg', 'note' => ''],
                ['picid' => '0102', 'picurl' => 'http://127.0.0.1/404.jpg', 'note' => ''],
                ['picid' => '0103', 'picurl' => 'http://127.0.0.1/404.jpg', 'note' => ''],
                ['picid' => '0104', 'picurl' => 'http://127.0.0.1/404.jpg', 'note' => ''],
                ['picid' => '0201', 'picurl' => 'http://127.0.0.1/404.jpg', 'note' => ''],
                ['picid' => '0202', 'picurl' => 'http://127.0.0.1/404.jpg', 'note' => ''],
                ['picid' => '0203', 'picurl' => 'http://127.0.0.1/404.jpg', 'note' => ''],
                ['picid' => '0204', 'picurl' => 'http://127.0.0.1/404.jpg', 'note' => ''],
                ['picid' => '0301', 'picurl' => 'http://127.0.0.1/404.jpg', 'note' => ''],
                ['picid' => '0302', 'picurl' => 'http://127.0.0.1/404.jpg', 'note' => ''],
                ['picid' => '0303', 'picurl' => 'http://127.0.0.1/404.jpg', 'note' => ''],
                ['picid' => '0401', 'picurl' => 'http://127.0.0.1/404.jpg', 'note' => ''],
                ['picid' => '0501', 'picurl' => 'http://127.0.0.1/404.jpg', 'note' => ''],
                ['picid' => '0502', 'picurl' => 'http://127.0.0.1/404.jpg', 'note' => ''],
                ['picid' => '0503', 'picurl' => 'http://127.0.0.1/404.jpg', 'note' => ''],
                ['picid' => '0601', 'picurl' => 'http://127.0.0.1/404.jpg', 'note' => ''],
                ['picid' => '0602', 'picurl' => 'http://127.0.0.1/404.jpg', 'note' => ''],
                ['picid' => '0701', 'picurl' => 'http://127.0.0.1/404.jpg', 'note' => ''],
                ['picid' => '0702', 'picurl' => 'http://127.0.0.1/404.jpg', 'note' => ''],
                ['picid' => '0703', 'picurl' => 'http://127.0.0.1/404.jpg', 'note' => ''],
                ['picid' => '0704', 'picurl' => 'http://127.0.0.1/404.jpg', 'note' => ''],
                ['picid' => '0801', 'picurl' => 'http://127.0.0.1/404.jpg', 'note' => ''],
                ['picid' => '0802', 'picurl' => 'http://127.0.0.1/404.jpg', 'note' => ''],
                ['picid' => '0901', 'picurl' => 'http://127.0.0.1/404.jpg', 'note' => ''],
                ['picid' => '0902', 'picurl' => 'http://127.0.0.1/404.jpg', 'note' => ''],
            ],

            'resubmit' => 0, // 继续申请标志
        ];
        $data = serialize($data);
        $data = [
            'orderno' => '赣01-170428-001',

            'custName' => 'test', // 客户名称
            'IdType' =>  '000', // 证件类型
            'IdNo' => '411327199003292913', // 证件编号

            'serialize_data'=>$data,
        ];
        $r = Api::request('/bank/business/ask-for-used-car-service', $data);
        return json_decode($r->content);
    }

    /**
     * 几米 模拟获取accesstoken
     * @desc 模拟几米获取accesstoken
     * @return object response
     */
	public function actionGetJiMiAccessToken()
    {
        $method = "jimi.oauth.token.get";
        $timestamp = date("Y-m-d H:i:s");
        $app_key = "8FB345B8693CCD0012BB58275CB4AD6E";
        $app_secret = "8868508598ca4de19057a7ce5cde2bbd";
        $sign_method = "md5";
        $v = "1.0";
        $format = "json";
        $user_id = "易商新程";
        $user_pwd_md5 = md5("ysjr.0");
        $expires_in = 60;
        $data = [
            'method' => $method,
            'timestamp' => $timestamp,
            'app_key' => $app_key,
            'sign_method' => $sign_method,
            'v' => $v,
            'format' => $format,
            'user_id' => $user_id,
            'user_pwd_md5' => $user_pwd_md5,
            'expires_in' => $expires_in,
        ];
        ksort($data); // 排序
        $x = '';
        foreach ($data as $k => $v){
            $x .= $k.$v; // 拼接
        }
        $y = $app_secret.$x.$app_secret; // 前后加app secret
        $z = md5($y); // 加密
        $z = strtoupper($z);
        $sign = $z; // 转16进制
        $data['sign'] = $sign;
        $client = new Client();
        $request = $client->createRequest()->setMethod('get')->setUrl('http://open.aichezaixian.com/route/rest')->setData($data);
        $response = $request->send();
        $r = json_decode($response->content);
        /*foreach ($data as $k => $v){
            $a[] = $k."=".$v;
        }
        $b = implode('&', $a);
        $url = 'http://open.aichezaixian.com/route/rest'."?".$b;
        var_dump($url);
        var_dump($r);exit;*/
        return $r;
    }

    /**
     * 几米 模拟获取子账户信息
     * @desc 根据账户，获取该账户下的所有子账户信息
     */
    public function actionGetUserChildList()
    {
        $jimi = new Jimi();
        $r = $jimi->getUserChildList();
        var_dump($r);exit;
    }

    /**
     * 几米 模拟获取所有IMEI信息信息
     * @desc 根据账户，获取该账户下的所有IMEI信息
     */
    public function actionGetUserDevList()
    {
        $jimi = new Jimi();
        $r = $jimi->getUserDevList();
        var_dump($r);exit;
    }

    /**
     * 几米 获取该账户下所有IMEI的最新定位数据
     * @desc 7.8根据账户，获取该账户下所有IMEI的最新定位数据
     */
    public function actionGetUserDevLocation()
    {
        $jimi = new Jimi();
        $r = $jimi->getUserDevLocation();
        var_dump($r);exit;
    }

    /**
     * 几米 获取gps
     */
    public function actionGetGps()
    {
        echo 12345;
    }

    /**
     * 模拟申请专项卡
     */
    public function actionAskForSpecialCard()
    {
//        $order = '皖05-170329-001';
        $order = '皖05-170509-004';
        $arr = array (
            'o_number' => '皖01-170424-001',
            'loanamount' => '104600.00',
            'term' => '36',
            'feeratio' => '9.025',
            'feeamount' => '9440.15',
            'carprice' => '152801.00',
            'loanratio' => '75',
            'chnsname' => '阳开伟',
            'engname' => 'weikaiyang',
            'sex' => '1',
            'birthdata' => '19940210',
            'custsort' => '000',
            'custcode' => '342523199402101019',
            'authref' => '0',
            'statdate' => '2017-06-26',
            'mrtlstat' => '1',
            'edulvl' => '大专',
            'mvblno' => '18715531355',
            'hprovince' => '安徽省',
            'hcity' => '池州市',
            'hcounty' => '贵池区',
            'haddrass' => '0',
            'hphonzono' => '0',
            'hphoneno' => '0',
            'homezip' => '0',
            'indate' => '20170626',
            'unitname' => '无锡园林有限公司',
            'cprovince' => '安徽省',
            'ccity' => '池州市',
            'ccounty' => '贵池区',
            'caddress' => '0',
            'corpzip' => '0',
            'cophozono' => '0',
            'cophoneno' => '0510823311',
            'cophonext' => '0',
            'yearincome' => '0',
            'joindate' => '201706',
            'modelcode' => '个体',
            'occptn' => '职员',
            'reltname1' => '刘先国',
            'reltsex1' => '男',
            'reltship1' => '兄弟姐妹',
            'reltmobl1' => '15861518858',
            'relaphone1' => '0',
            'reltname2' => '刘欢',
            'reltsex2' => '女',
            'reltship2' => '朋友',
            'reltmobl2' => '15249936601',
            'relaphone2' => '0',
            'accgetm' => '自取',
            'rmbcred' => '114040.15',
            'mamobile' => '18715531355',
            'smsphone' => '18715531355',
            'drawmode' => '自取',
            'drawaddr' => '住宅地址',
            'machgf' => '是',
            'machgmobile' => '0',
            'emladdrf' => 0,
            'stmtemail' => '0',
            'shenqing_submit' => '提交银行',
            'pic' => '',
            'bank_sign_code' => 'icbc_zjfh',
            'dot_site_sign_code' => 'yishang_dot_site_1',
        );
        $data =serialize($arr);
        $client = new Client([
//            'baseUrl' => "http://192.168.1.102:9101/bank/business/submit-special-card",
        ]);
        $token = '4845304c8a8c44e57dbeae4b863da953';
        $timestamp = time();
        $nonce = $timestamp.rand(1000, 9999);
        $sign_key = '60f46cbd6a52c73b0176d6d72c21aec3';
        $signature = md5($token.$timestamp.$nonce.$sign_key);
        $request = $client->createRequest()
            ->setMethod('get')
            ->setUrl('http://192.168.1.102:9101/bank/business/submit-special-card')
            ->addHeaders([
                'token' => $token,
                'timestamp' => $timestamp,
                'nonce' => $nonce,
                'signature' => $signature,
            ])
        ->setData(['orderno'=>$order, 'serialize_data'=>$data]);
        $response = $request->send();
        $r = json_decode($response->content);
        return $r;
    }

    /**
     * 模拟查询专项卡开卡进度
     */
    public function actionInquerySpecialCard($orderno)
    {
        $client = new Client();
        $token = '4845304c8a8c44e57dbeae4b863da953';
        $timestamp = time();
        $nonce = $timestamp.rand(1000, 9999);
        $sign_key = '60f46cbd6a52c73b0176d6d72c21aec3';
        $signature = md5($token.$timestamp.$nonce.$sign_key);
        $request = $client->createRequest()
            ->setMethod('get')
            ->setUrl('http://192.168.1.102:9101/bank/business/inquery-special-card-schedule')
            ->addHeaders([
                'token' => $token,
                'timestamp' => $timestamp,
                'nonce' => $nonce,
                'signature' => $signature,
            ])
            ->setData(['orderno'=>$orderno]);
        $response = $request->send();
        $r = json_decode($response->content);
        return $r;
    }
}